/*
 * app.c
 *
 *  Created on: Jul 12, 2021
 *      Author: dbw
 */
#include "app.h"
#include "common.h"
#include "drv_uart.h"
#include "test.h"
#include "examples.h"
#include "stack_monitor.h"

#define LOG_TAG 	"app"
#define LOG_LEVEL	LOG_LEVEL_VERBOSE
#include "logger.h"

static void uart1_rx_handler(uart_t *uart, uint8_t *buf, uint32_t len)
{
    LOG_HEX_V(buf, len, "recv data:");
}

static void driver_init(void)
{
    drv_uart_init();
    drv_uart_set_callback(&uart1, uart1_rx_handler);
}

static void show_info(void)
{
    printf("===========demo==========\r\n");
}

static void test(void)
{

}

static void app_loop(void)
{

}

void app_main(void)
{
    sys_init();
    driver_init();

    show_info();

    test();
    examples_run();

    stack_mnt_show("after examples");

    while (1)
    {
        app_loop();
    }
}
